<script setup>
import { onBeforeMount, ref } from "vue";

// 按需导入api
import { getAllProducts } from "@/apis/ProductApi";

const products = ref([])

onBeforeMount(async () => {
  products.value = await getAllProducts()

})

</script>

<template>
    <h2 class="test">哈哈哈</h2>
  
    <el-button type="primary">Primary</el-button>

    <el-table :data="products" style="width: 100%">
        <el-table-column prop="id" label="学号" width="180" />
        <el-table-column prop="name" label="姓名" width="180" />
        <el-table-column prop="price" label="价格" />
    </el-table>
</template>
  
<style scoped lang="scss">

.test{
    color: $warnColor;
}

</style>
  